﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

using Com.Framework;
using Com.Framework.Data;
using Com.Web.coffinegurunaru.AppLogic.Page;
using Com.Library.DB.Store;

namespace Com.Web.coffinegurunaru.store
{
	public partial class search_store : WebPage
	{
		public List<StoreEntity> StoreList
		{
			get;
			set;
		}

		public int PageNo
		{
			get;
			set;
		}

		public byte PageSize
		{
			get { return 10; }
		}

		public string CityName { get; set; }
		public string StoreName { get; set; }

		protected void Page_Load(object sender, EventArgs e)
		{
			this.LeftMenuType = 2;

			PageNo = Request.QueryString["PageNo"].Parse(1);
			CityName = Request.QueryString["CityName"].Parse(string.Empty);
			StoreName = Request.QueryString["StoreName"].Parse(string.Empty);
			ListData<StoreEntity, OutputEntity> StoreData = StoreModel.GetSearch(CityName, StoreName, PageNo, PageSize);
			StoreList = StoreData.Record;
			string Query = string.Empty;
			Query += CityName != string.Empty ? "&CityName=" + Server.UrlEncode(CityName) : string.Empty;
			Query += StoreName != string.Empty ? "&StoreName=" + Server.UrlEncode(StoreName) : string.Empty;

			UC_Paging.TotalCount = StoreData.Output.CntTotal;
			UC_Paging.PageName = "PageNo";
			UC_Paging.PageNo = PageNo;
			UC_Paging.PageSize = PageSize;
			UC_Paging.Query = Query;
		}
	}
}

